package ps.yj.y1j0.util;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author yanjun
 */
public class YJFileTool {
    public static Boolean write(String path, String name, String content) {
        File file = new File(path);
        file.mkdirs();
        file = new File(path + name);
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException ex) {
                ex.printStackTrace();
                return Boolean.FALSE;
            }
        }
        FileOutputStream output;
        try {
            output = new FileOutputStream(file);
            output.write(content.getBytes("UTF-8"));
            output.flush();
            output.close();
        } catch (IOException ex) {
            ex.printStackTrace();
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }
}
